Skip to main content

Jogging a Robot

See the Robotics_Jogging.project sample project in the installation directory of CODESYS under ..\CODESYS SoftMotion\Examples.

This example demonstrates how to jog an axis group with the SMC_GroupJog2 POU.

It is recommended to install the CODESYS Depictor for this example (the free demo version is sufficient). Alternatively, you could also remove the corresponding code parts from the example in order to use the example without Depictor.

Application

In order to demonstrate the most general case possible, the example has the following functions:

  1. Use of a robot with singularities (6-axis articulated robot). The example shows that you can move the robot through singularities in ACS and then continue jogging in a Cartesian way in a different configuration.

  2. Shifting and rotation of the machine coordinate system (MCS) of the robot with respect to the world coordinate system (WCS). In this way, you can see how jogging differs in MCS and WCS.

  3. Configuration of a tool shifted and rotated with respect to the flange (F). In the figure below, you can see the tool and the shifting and rotation of the TCS with respect to the flange (F).

sm_img_example_jogging_roboter.png

Structure of the application

Main program

  • The main program PLC_PRG consists of a state machine, which

    1. Activates the axis group (state 0)

    2. Configures the tool (state 5)

    3. Configures the MCS (state 6)

    4. Starts the jogging (state 10)

  • In state 20, jogging errors are handled and movement commands are accepted (Move to Position switch in the visualization).

  • The other states are used to perform the movement (60, 70) and to handle and acknowledge errors (900, 1000).

  • According to the state machine, all robotics POUs and the GroupJog2 program are called cyclically and some calculations are done for the 3D display in Depictor.

GroupJog2 program

This program contains a state machine with the following steps:

  • In state 10, the inputs of SMC_GroupJog2 are set and the configuration of the robot axes is read (SMC_GroupReadActualPosition). This configuration is done in state 20 in the axis group (SMC_SetKinConfiguration).

  • In state 30, the system reacts to errors during jogging, as well as to changes in the settings of jogging (for example, to a changed coordinate system). If there is a change, then the system switches back to state 10.

  • State 50 is entered on a falling edge of the Enable input. Jogging is stopped by MC_GroupHalt.

Commissioning

Compile and start the created program. You can use the visualization to run the robot. You can define all relevant settings for jogging (for example, in which coordinate system is jogged and at which velocity).

If you have installed the CODESYS Depictor, then it is recommended that you place the window with the Depictor (Scene POU) next to the visualization window.

The Depictor represents the TCS (Tool Coordinate System) at the front of the robot. Moreover, the current axis of rotation of the TCS is displayed in purple. This is useful to check the different types of orientation change (for example, test the ABC_as_ACS option and the TCS coordinate system).